package com.neusoft.tijian.vo;

public class RespVo {
    private Integer code;
    private String msg;
    private Object body;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    public static RespVo success(Object body){
        RespVo respVo = new RespVo();
        respVo.setCode(200);
        respVo.setMsg("操作成功");
        respVo.setBody(body);
        return respVo;
    }

    public static RespVo success(){
        RespVo respVo = new RespVo();
        respVo.setCode(200);
        respVo.setMsg("操作成功");
        return respVo;
    }

    public static RespVo error(String msg){
        RespVo respVo = new RespVo();
        respVo.setCode(300);
        respVo.setMsg(msg);
        return respVo;
    }
}
